public class test1 {
    //力扣 3.无重复的最长子串
    //网课的
    public static void main(String[] args) {
        String s = "tmmzuxt";

        char[] chars = s.toCharArray();
        int n = chars.length;

        int left = 0;
        int right = 0;
        int max = 0;
        int[] hash=new int[128];
        while (right<n){
            hash[chars[right]]++;
            while(hash[chars[right]]>1){
                hash[chars[left++]]--;
            }
            max = Math.max(max,right-left+1);

            right++;
        }
        System.out.println(max);
    }


}
